package neptune.web.server.operations;

import it.robertobifulco.ias.IncorrectParamsException;
import it.robertobifulco.ias.Operation;
import neptune.manager.model.cluster.PhysicalNode;
import neptune.web.server.ApplicationManager;

public class GetPhysicalMachine implements Operation {

	public static String ID = "GetPhysicalMachine";

	public Object[] execute(Object[] args) throws IncorrectParamsException,
			Exception {
		String idPhysicalNode = (String) args[0];
		PhysicalNode physicalNode = ApplicationManager.getApplicationManager()
				.getNeptuneManager().getPhysicalMachine(idPhysicalNode);
		return new Object[] { physicalNode };
	}

	public String getDescription() {
		return "Get a physical machine from the cluster";
	}

	public String getID() {
		return ID;
	}

}
